<template>
  <div>
    <!-- <el-collapse-transition>
      <el-card v-if="searchShow" shadow="never" :body-style="{ padding: '20px 10px 0px 20px' }">
      </el-card>
    </el-collapse-transition> -->
    <el-card shadow="never" class="aui-card--fill" :style="searchShow?'margin-top: 10px;':''">
      <vxe-toolbar :setting="{immediate:true}">
        <template v-slot:buttons>
          <!-- <el-button v-if="$hasPermission('udf:udfFillingLog:save')" type="primary" @click="addOrUpdateHandle()">
            {{ $t('add') }}</el-button> -->
          <!-- <el-button v-if="$hasPermission('udf:udfFillingLog:delete')" type="danger" @click="deleteHandle()">
            {{ $t('deleteBatch') }}</el-button> -->
          <el-form v-if="searchShow" :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
            <!--文本框-->
            <el-form-item>
              <el-input v-model="dataForm.btypeName" placeholder="填报单位" clearable></el-input>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="getDataList()">{{ $t('query') }}</el-button>
              <el-button @click="searchReset()">{{ $t('reset') }}</el-button>
            </el-form-item>
            <el-form-item>
              <span>{{tips}}</span>
            </el-form-item>
          </el-form>
        </template>
        <template v-slot:tools>
          <el-button icon="el-icon-search" @click="searchShowHandle()" circle></el-button>
          <el-button icon="el-icon-refresh" @click="getDataList()" circle></el-button>
          <el-button icon="el-icon-download" @click="$refs.xTable.openExport()" circle></el-button>
        </template>
      </vxe-toolbar>
      <vxe-table export-config ref="xTable" :loading="dataListLoading" class="vxe-table-element" auto-resize @select-change="dataListSelectionChangeHandleVex"
        @select-all="dataListSelectionAllChangeHandleVex" :data="dataList" highlight-current-row>
        <vxe-table-column field="btypeName" title="单位"></vxe-table-column>
        <vxe-table-column field="cntAll" title="应报"> </vxe-table-column>
        <vxe-table-column field="cntYes" title="已报"> </vxe-table-column>
        <vxe-table-column field="cntNo" title="未报"> </vxe-table-column>
        <vxe-table-column field="cntIng" title="进行中"> </vxe-table-column>
      </vxe-table>
      <el-pagination :current-page="page" :page-sizes="pageSizes" :page-size="limit" :total="total" layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle" @current-change="pageCurrentChangeHandle">
      </el-pagination>
    </el-card>
  </div>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import CDATA from './common/constant'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      searchShow: true,
      mixinViewModuleOptions: {
        getDataListURL: '/udf/udfFillingReport/page',
        getDataListIsPage: true
      },
      dataForm: {
        flag: '3',
        title: '',
        fillCycle: '',
        fillCycles: '',
        typeCode: '',
        cntType: '',
        btypeName: ''
      }
    }
  },
  created () {
    this.initParams = this.$route.params
    this.dataForm.fillCycle = this.initParams.fillCycle
    this.dataForm.typeCode = this.initParams.typeCode
    this.dataForm.cntType = this.initParams.cntType
    this.tips = `${this.initParams.typeName} - ${this.initParams.fillTitle}`
    this.tips = this.tips + ' - ' + this.$getDataItem(CDATA.cntTypes, this.initParams.cntType, 'value').label
  },
  components: {},
  methods: {}
}
</script>
